﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SPMigrationOracleUtility
{
    public partial class Menu : Form
    {
        public Menu()
        {
            InitializeComponent();
        }
        public Menu(string Username)
        {
            InitializeComponent();
            lblUserName.Text = Username; 
        }
        private void changePasswordToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ChangePassword objFrm = new ChangePassword(lblUserName.Text);
            objFrm.ShowDialog();  
        }

        private void singleDataImportToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //DataFromSingle objFrm = new DataFromSingle();
            //objFrm.ShowDialog();  
        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("Are you sure want to Exit ?", "Message", MessageBoxButtons.YesNo,MessageBoxIcon.Question);
            if(dr==DialogResult.Yes)
            {
                 Application.Exit();
            }
        }

        private void addMappingToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frm_Mapping map = new frm_Mapping();
            map.Show();
        }

        private void runMappingToolStripMenuItem_Click(object sender, EventArgs e)
        {
            RunMapping runMap = new RunMapping("Oracle Migration");
            runMap.Show();
        }

        private void editMappingToolStripMenuItem_Click(object sender, EventArgs e)
        {
            view_mapping_lists obj = new view_mapping_lists();
            Mapping_Trans dt = new Mapping_Trans();
            dt.viewMap = "Edit";
            obj.Enable(dt.viewMap);
            obj.Show();
        }

        private void viewMappingToolStripMenuItem_Click(object sender, EventArgs e)
        {
            view_mapping_lists obj = new view_mapping_lists();
            Mapping_Trans dt = new Mapping_Trans();
            dt.viewMap = "View";
            obj.Enable(dt.viewMap);
            obj.Show();
        }

        private void deleteMappingToolStripMenuItem_Click(object sender, EventArgs e)
        {
            view_mapping_lists obj = new view_mapping_lists();
            Mapping_Trans dt = new Mapping_Trans();
            dt.viewMap = "Delete";
            obj.Enable(dt.viewMap);
            obj.Show();
        }

        private void toolStripMenuItem1_Click(object sender, EventArgs e)
        {
            //MigrationLog objLogForm = new MigrationLog();
            //objLogForm.Show();
        }

        private void addMappingToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            ExcelSPmigration map = new ExcelSPmigration();
            //Mapping_Trans dt = new Mapping_Trans();
            //dt.migMode = "Excel";
            map.Show();
        }

        private void editMappingToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            view_mapping_lists obj = new view_mapping_lists();
            Mapping_Trans dt = new Mapping_Trans();
            dt.viewMap = "Edit";
            dt.migMode = "Excel";
            obj.Enable(dt.viewMap);
            obj.MigrationMode(dt.migMode);
            obj.Show();
        }

        private void viewMappingToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            view_mapping_lists obj = new view_mapping_lists();
            Mapping_Trans dt = new Mapping_Trans();
            dt.viewMap = "View";
            dt.migMode = "Excel";
            obj.Enable(dt.viewMap);
            obj.MigrationMode(dt.migMode);
            obj.Show();
        }

        private void deleteMappingToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            view_mapping_lists obj = new view_mapping_lists();
            Mapping_Trans dt = new Mapping_Trans();
            dt.viewMap = "Delete";
            dt.migMode = "Excel";
            obj.Enable(dt.viewMap);
            obj.MigrationMode(dt.migMode);
            obj.Show();
        }

        private void runMappingToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            RunMapping runMap = new RunMapping("Excel Migration");
            runMap.Show();
        }



        private void Menu_Load(object sender, EventArgs e)
        {

        }

        private void oracleLogsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MigrationLog objLogForm = new MigrationLog("Oracle Migration");
            objLogForm.Show();
        }

        private void excelLogsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MigrationLog objLogForm = new MigrationLog("Excel Migration");
            objLogForm.Show();
        }

        private void deleteLogsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            RunMappingComp obj = new RunMappingComp();
            obj.Delete_List_Records();
            ProgressBar pg = new ProgressBar();
            
        }
    }
}
